<template>
    <div>
      <div style="width:100%;height:100%" v-loading="loading">
        <iframe
          ref="Iframe"
          id="bdIframe"
          src="http://101.200.216.224:85/#/?userId=2"
          frameborder="0"></iframe>
      </div>
    </div>
</template>

<script>
    export default {
        name: "index",
        data(){
            return{
                widthClient:document.body.clientWidth,
                heightClient:document.body.clientHeight,
                loading:false,
            }
        },
        methods:{
          iframeLoad(){
              this.loading = true;
              const iframe = this.$refs.Iframe;
              if(iframe.attachEvent){
                  iframe.attachEvent('onload',()=>{this.loading=false})
              }else {
                  iframe.onload = ()=>{this.loading = false}
              }
            }
        },

        mounted() {
            const oIframe = document.getElementById("bdIframe");
            const dev  = document.documentElement.clientWidth;
            const devHi = document.documentElement.clientHeight;
            oIframe.style.width = (dev-220) + 'px';
            oIframe.style.height = (devHi-120) + 'px';
            this.iframeLoad();
        }
    }
</script>

<style scoped>

</style>
